﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Delegate
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
        public delegate void GetString(String MyString1, String MyString2);
        public GetString MyGetData;

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (MyGetData != null)
            {
                MyGetData(textBox1.Text, textBox2.Text);
            }
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            if (MyGetData != null)
            {
                MyGetData(textBox1.Text, textBox2.Text);
            }
        }
    }
}
